<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>显式原型与隐式原型内存结构</title>
</head>

<body>
    <script>
        function Fn() {}
        var fn = new Fn();
        console.log(Fn.prototype, fn.__proto__);
        console.log(Fn.prototype === fn.__proto__);

        // 如何给所有实例对象添加方法？通过原型
        Fn.prototype.test = function() {
            console.log('test()');
        }
    </script>
</body>

</html>